package com.me.libgdx_test;

import com.badlogic.gdx.utils.Json;
import com.me.libgdx_test.ClassUnlockablePrototypes.UnlockFactory;

public class ClassUnlockables {
	//Just some test data here to make sure everything is working correctly
	static String test_json = "{\"classes\":[{\"value\":1},{\"value\":2},{\"value\":3}]," +
			"\"races\":[{\"value\":0},{\"value\":1},{\"value\":2},{\"value\":3}]," +
			"\"levels\":[{\"value\":0},{\"value\":1},{\"value\":2},{\"value\":3}]," +
			"\"spells\":[{\"value\":0},{\"value\":1},{\"value\":2},{\"value\":3},{\"value\":4},{\"value\":5}]," +
			"\"upgrades\":[{\"id\":1,\"level\":9}," +
			"{\"id\":2,\"level\":3}," +
			"{\"id\":3,\"level\":2}," +
			"{\"id\":4,\"level\":1}," +
			"{\"id\":5,\"level\":7}," +
			"{\"id\":6,\"level\":0}," +
			"{\"id\":7,\"level\":2}," +
			"{\"id\":8,\"level\":6}," +
			"{\"id\":9,\"level\":7}," +
			"{\"id\":10,\"level\":2}," +
			"{\"id\":11,\"level\":4}," +
			"{\"id\":12,\"level\":1}," +
			"{\"id\":13,\"level\":6}," +
			"{\"id\":14,\"level\":2}," +
			"{\"id\":15,\"level\":8}," +
			"{\"id\":16,\"level\":3}," +
			"{\"id\":17,\"level\":2}]," +
			"\"player_assets\":[{\"exp\":0,\"honor\":0,\"gold\":0,\"deaths\":0,\"kills\":0}]," +
			"\"history\":[{\"player_level\":1,\"player_class\":2,\"score\":100000,\"completed\":true}]," +
			"\"custom_character_items\":[{\"value\":1},{\"value\":2},{\"value\":3}]," +
			"\"current_custom_character\":[{\"head\":1,\"torso\":2,\"legs\":3}]," +
			"}";

	private ClassUnlockablePrototypes prototype_holder;
	private static ClassLogDisplay logger;
	private ClassNetwork network;
	ClassUnlockables(String json_response, ActivityMain game){
		logger = new ClassLogDisplay("Unlockables");
		json_response = test_json;
		//logger.print(json_response);
		
		prototype_holder = new ClassUnlockablePrototypes();
		
		network = new ClassNetwork(prototype_holder, game, true);
		network.get();
		//network.post();
		
		//prototype_holder.set_factory(new Json().fromJson(UnlockFactory.class, json_response));
		//prototype_holder.get_factory().print_data();
	}
	public void save_data_to_server(){
		network.post();
	}
	public ClassUnlockablePrototypes get_unlockable_prototypes(){
		return prototype_holder;
	}
}
